Skip to content

Conversation

@captainzmc
Copy link
Member

@captainzmc captainzmc commented Jun 23, 2021

What changes were proposed in this pull request?

Use RATIS-Streaming to make ContainerStateMachine support writing streaming to the local.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-5366

How was this patch tested?

CI test will be added after the client is finished

@captainzmc captainzmc changed the title HDDS-5366. Implement stream method to ContainerStateMachine. HDDS-5366. [Ozone-Streaming]Implement stream method to ContainerStateMachine. Jun 23, 2021
@captainzmc captainzmc changed the title HDDS-5366. [Ozone-Streaming]Implement stream method to ContainerStateMachine. HDDS-5366. [Ozone-Streaming] Implement stream method to ContainerStateMachine. Jun 23, 2021
@bshashikant bshashikant requested a review from szetszwo June 23, 2021 05:05
Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@captainzmc , thanks a lot for working on this. Just have a minor comment.

BTW, let me update the HDDS-4454 branch with master. Please update your branch as well.

Comment on lines 508 to 527
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make it async like below:

  public CompletableFuture<DataStream> stream(RaftClientRequest request) {
    return CompletableFuture.supplyAsync(() -> {
      try {
        ContainerCommandRequestProto requestProto =
            getContainerCommandRequestProto(gid,
                request.getMessage().getContent());
        DispatcherContext context =
            new DispatcherContext.Builder()
                .setStage(DispatcherContext.WriteChunkStage.WRITE_DATA)
                .setContainer2BCSIDMap(container2BCSIDMap)
                .build();

        ContainerCommandResponseProto response = runCommand(
            requestProto, context);
        String path = response.getMessage();
        return new LocalStream(new StreamDataChannel(Paths.get(path))));
      } catch (IOException e) {
        throw new CompletionException("Failed to create data stream", e);
      }
    }, executor);
  }

@captainzmc captainzmc force-pushed the streaming-add-stream-2 branch from 44f95ae to 51dd9c5 Compare June 23, 2021 12:16
@captainzmc captainzmc closed this Jun 23, 2021
@captainzmc captainzmc reopened this Jun 23, 2021
Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

@szetszwo szetszwo merged commit ed929c8 into apache:HDDS-4454 Jun 23, 2021
@captainzmc
Copy link
Member Author

Thanks @szetszwo for the review.

captainzmc added a commit that referenced this pull request Jul 22, 2021
captainzmc added a commit to captainzmc/hadoop-ozone that referenced this pull request Jul 26, 2021
captainzmc added a commit to captainzmc/hadoop-ozone that referenced this pull request Jul 26, 2021
captainzmc added a commit to captainzmc/hadoop-ozone that referenced this pull request Jul 27, 2021
szetszwo pushed a commit that referenced this pull request Jul 28, 2021
szetszwo pushed a commit that referenced this pull request Aug 26, 2021
szetszwo pushed a commit that referenced this pull request Sep 8, 2021
szetszwo pushed a commit that referenced this pull request Oct 1, 2021
szetszwo pushed a commit that referenced this pull request Oct 19, 2021
szetszwo pushed a commit that referenced this pull request Oct 28, 2021
szetszwo pushed a commit that referenced this pull request Nov 15, 2021
szetszwo pushed a commit that referenced this pull request Nov 30, 2021
captainzmc added a commit that referenced this pull request Dec 20, 2021
szetszwo pushed a commit that referenced this pull request Dec 30, 2021
szetszwo pushed a commit that referenced this pull request Jan 20, 2022
captainzmc added a commit that referenced this pull request Feb 9, 2022
szetszwo pushed a commit that referenced this pull request Feb 16, 2022
szetszwo pushed a commit that referenced this pull request Mar 15, 2022
szetszwo pushed a commit that referenced this pull request Mar 24, 2022
szetszwo pushed a commit to szetszwo/ozone that referenced this pull request May 6, 2022
szetszwo pushed a commit that referenced this pull request May 13, 2022
szetszwo pushed a commit that referenced this pull request May 24, 2022
szetszwo pushed a commit that referenced this pull request Jun 9, 2022
captainzmc added a commit to captainzmc/hadoop-ozone that referenced this pull request Jul 4, 2022
szetszwo pushed a commit that referenced this pull request Oct 25, 2022
…eMachine. (#2358).  Contributed by mingchao zhao

(cherry picked from commit 16bafc6)
(cherry picked from commit b3495e8d39ab6ce09637f9ef05acfcf66e3087b8)
szetszwo pushed a commit that referenced this pull request Nov 7, 2022
…eMachine. (#2358).  Contributed by mingchao zhao

(cherry picked from commit 16bafc6)
(cherry picked from commit b3495e8d39ab6ce09637f9ef05acfcf66e3087b8)
(cherry picked from commit e15e987)
szetszwo pushed a commit that referenced this pull request Dec 1, 2022
…eMachine. (#2358).  Contributed by mingchao zhao

(cherry picked from commit d4bf89a)
szetszwo pushed a commit that referenced this pull request Dec 16, 2022
…eMachine. (#2358).  Contributed by mingchao zhao

(cherry picked from commit d4bf89a)
nishitpatira pushed a commit to nishitpatira/ozone that referenced this pull request Dec 16, 2022
…eMachine. (apache#2358).  Contributed by mingchao zhao

(cherry picked from commit d4bf89a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants